package com.wulian.common.euums;

import lombok.Getter;
import lombok.Setter;

/**
 * 
* @ClassName: DeviceClassEnum 
* @Description: TODO(设备分类枚举类) 
* @author 马志豪
* @date 2019-11-11 15:14:16
*
 */
public enum DeviceClassifyEnum {
	//指标类型
	MONITOR_TYPE_ONE("1","监测设备"),
	MONITOR_TYPE_TWO("2","被监测设备"),
	MONITOR_TYPE_THREE("3","移动设备");
	@Getter
	@Setter
	private String code;
	@Getter
	@Setter
	private String value;
	
	private DeviceClassifyEnum(String code, String value) {
		this.code = code;
		this.value = value;
	}


	/**
     * 根据code获取去value
     * @param code
     * @return
     */
    public static String getValueByCode(String code){
        for(DeviceClassifyEnum monitorTypeEnum:DeviceClassifyEnum.values()){
            if(code.equals(monitorTypeEnum.getCode())){
                return monitorTypeEnum.getValue();
            }
        }
        return  null;
    }
	
}
